-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Ensure null inputs to array setop functions return null output #19683
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| let l_values = if let Some(first_arr) = first_arr { | ||
| converter.convert_columns(&[first_arr])? | ||
| } else { | ||
| ele_should_be_null = true; | ||
| converter.empty_rows(0, 0) | ||
| }; | ||
|
|
||
| let r_values = if let Some(second_arr) = second_arr { | ||
| converter.convert_columns(&[second_arr])? | ||
| } else { | ||
| ele_should_be_null = true; | ||
| converter.empty_rows(0, 0) | ||
| let (l_values, r_values) = match (l_arr, r_arr) { | ||
| (Some(l_arr), Some(r_arr)) => ( | ||
| converter.convert_columns(&[l_arr])?, | ||
| converter.convert_columns(&[r_arr])?, | ||
| ), | ||
| _ => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Little drive-by refactor here to skip the set logic below for nulls
kosiew
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
| continue; | ||
| } | ||
|
|
||
| for i in r_start.as_usize()..r_end.as_usize() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you intentionally want to shadow i which is used in the outer for loop?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This wasn't intentional, refactored the names to clear things up 👍
Which issue does this PR close?
Rationale for this change
Explained in issue.
What changes are included in this PR?
Change array_except, array_intersect and array_union UDFs to return null if either input is null.
Are these changes tested?
Added & fixed tests.
Are there any user-facing changes?
Behaviour change to a function output.